<!DOCTYPE html>
<html>
{include file="head.html"}
 
<body>

<div class="fullscreen">
  <div class="scroll_content">
    <div class="topfixed">
    <div class="t_left"><a href="/index.php?m=cyitem&a=my"><i class="back"></i></a></div>
      <div class="t_main">我的项目</div>
      <div class="t_right"><a href="/index.php?m=show&id={$data.id}" class="link">查看</a></div>
      
    </div>
    <div class="paddingheight"></div>
    <div class="comblock">
    <form method="post" action="/index.php?m=cyitem&a=save&ajax=1" id="upload_form" class="form-horizontal ">
    <input type="hidden" name="id" value="{$data.id}" />
    
    <div class="project_add_box">
                    <table class="table">
                        <tr>
                            <th>封面图片：</th>
                            <td>
                                <div class="uploadbox">
                                    <a href="javascript:;" class="upload2">
                                        <input type="file"  name="upimg" id="upimg"
                                               style="width:30px;height:30px;font-size:30px;opacity:0;">
                                    </a>
                                   
                                    
                                    <input type="hidden" name="imgurl" value="{$data.imgurl}" id="imgurl">
                                    <span id="imgShow">
                                 	 {if $data.imgurl}
                                      <img src="{$data.imgurl|images_site}.100x100.jpg" align="center">
                                      {/if}
                                   </span>   

                                </div>
                            </td>
                        </tr>
                        <tr>
                            <th>项目标题：</th>
                            <td><input type="text" class="inp" name="title" value="{$data.title}" placeholder="请输标题"  placeholder="请输入标题"></td>
                        </tr>
                        
                        <tr>
                        	<td>所属类别：</td>
                            <td><select class="sel" name="catid">
                                <option value="0">请选择类别</option>
        {foreach item=c from=$cat_list}
                    <option value="{$c.catid}" {if $data.catid eq $c.catid or get('catid') eq $c.catid} selected="selected"{/if}>{$c.cname}</option>
                    {foreach item=c_2 from=$c.child}
                        <option value="{$c_2.catid}" {if $data.catid eq $c_2.catid or get('catid') eq $c_2.catid} selected="selected"{/if} class="o_c_2">|__{$c_2.cname}</option>
                        {foreach item=c_3 from=$c_2.child}
                        <option value="{$c_3.catid}" {if $data.catid eq $c_3.catid or get('catid') eq $c_3.catid} selected="selected"{/if} class="o_c_3"> |____{$c_3.cname}</option>
                        {/foreach}
                    {/foreach}
                    {/foreach}
                            </select></td>
                        </tr>
                        
                        <tr>
                            <th>结束时间：</th>
                            <td><input type="date" name="endtime" class="inp" value="{if $data.endtime}{$data.endtime|date:Y-m-d}{else}{php echo date("Y-m-d")}{/if}" placeholder="请选择结束时间"></td>
                        </tr>
                        <tr>
    	<th>发起人姓名</th>
        <td><input type="text" name="truename" class="inp" value="{$data.truename}" /></td>
    </tr>
    <tr>
    	<th>发起人手机</th>
        <td><input type="text" name="telephone" class="inp" value="{$data.telephone}" /></td>
    </tr>
                        <tr>
                            <td colspan="2">
                                项目介绍：
                                <textarea name="content" placeholder="请输入简短的项目介绍" class="area">{$data.content}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                市场分析：
                                <textarea name="scfx" placeholder="请输入简短的市场分析" class="area">{$data.scfx}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                运营方式：
                                <textarea name="yyfs" placeholder="请输入简短的运营方式" class="area">{$data.yyfs}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                合伙人要求：
                                <textarea placeholder="请输入简短的合伙人要求" name="hhryq" class="area">{$data.hhryq}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                已有资源及资金要求：
                                <textarea name="zjyq" placeholder="请输入简短的已有资源及资金要求" class="area">{$data.zjyq}</textarea>
                            </td>
                        </tr>
                        
                        <tr>
    <td colspan="2">详细内容： 
     <script type="text/plain" id="content" name="content" >{$data.content}</script></td>
  </tr>
                    </table>

                </div>
   
    
     <a href="javascript:;" id="post-submit"  class="cart_change_btn">提交</a>
       
       
    </div> 
    </form>
    
    </div>
    {include file="footer.html"}
</div>
<script src="/plugin/skyweb/lrz.mobile.min.js"></script>
<script language="javascript" src="/plugin/My97DatePicker/WdatePicker.js"></script>
<script>
$(function(){
	var input = document.querySelector('#upimg');

input.onchange = function () {
    // 也可以传入图片路径：lrz('../demo.jpg', ...
	$("#uploading").show();
    lrz(this.files[0],{width:1024}, function (results) {
      // 你需要的数据都在这里，可以以字符串的形式传送base64给服务端转存为图片。
      console.log(results);
	  $.post("/index.php?m=upload&a=base64",{content:results.base64},function(data){
		  $("#imgShow").html('<img src="'+data.imgurl+'.100x100.jpg" align="center">');
		  $("#imgurl").val(data.file); 
		   $("#uploading").hide();
	  },"json");
	  
	 
    });
}
	$("#post-submit").on("click",function(){
		$.post($("#upload_form").attr("action"),$("#upload_form").serialize(),function(data){
	
			if(data.url!="undefined"){
				skyToast("发布成功");
				setTimeout(function(){
				goBack();
				},1000);
			}else{
				skyToast(data.message);
			}
		},"json");
	});
});
</script>
{php loadEditor();}
<script language="javascript">
 
var editor=UE.getEditor('content',options)
</script>
</body>
</html>